<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    {switch name="name"}
   
       

        {case value="order"}
            <div class="row">
                <div class="col-md-12">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('城市开放')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="radio">
                                        <label for="row[city_model]-0"><input id="row[city_model]-0" name="row[city_model]" type="radio" value="0"   {$row.city_model?'':'checked'}    /> 默认全国</label>

                                      <label for="row[city_model]-1"><input id="row[city_model]-1" name="row[city_model]" type="radio" value="1"      {$row.city_model?'checked':''}  /> 开放城市</label>                                        

                                    </div>
                                </div>
                            </div>

<!--                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('接单模式')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="radio">
                                        <label for="row[task_model]-0"><input id="row[task_model]-0" name="row[task_model]" type="radio" value="0" {$row.task_model?'':'checked'} /> 抢单模式</label>

                                      <label for="row[task_model]-1"><input id="row[task_model]-1" name="row[task_model]" type="radio" value="1"  {$row.task_model?'checked':''} /> 派单模式</label>                                        

                                    </div>
                                </div>
                            </div>-->

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('派单距离')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-auto_distance" class="form-control" name="row[auto_distance]" min="0"   type="number" value="{$row.auto_distance ?? 5}">
                                        <span class="input-group-addon" id="c-auto_distance">千米</span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('自动标记时间')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-auto_mark_minutes" class="form-control" name="row[auto_mark_minutes]" min="0" type="number" value="{$row.auto_mark_minutes ?? 30}">
                                        <span class="input-group-addon" id="c-auto_mark_minutes">分钟</span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('自动取消时间')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-auto_close_minutes" class="form-control" name="row[auto_close_minutes]" min="0" type="number" value="{$row.auto_close_minutes ?? 30}">
                                        <span class="input-group-addon" id="c-auto_close_minutes">分钟</span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('自动确认时间')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-auto_receipt_days" class="form-control" name="row[auto_receipt_days]" min="0" type="number" value="{$row.auto_receipt_days ?? 1}">
                                        <span class="input-group-addon" id="c-auto_receipt_days">天</span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('自动解冻时间')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-auto_freeze_days" class="form-control" name="row[auto_freeze_days]" min="0" type="number" value="{$row.auto_freeze_days ?? 7}">
                                        <span class="input-group-addon" id="c-auto_freeze_days">天</span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('平台提成比例')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-auto_benfit" class="form-control" name="row[auto_benfit]" min="0" type="number" value="{$row.auto_benfit ?? 0}">
                                        <span class="input-group-addon" id="c-auto_benfit">%</span>
                                    </div>
                                </div>
                            </div>


                   
                </div>
            </div>
        {/case}


        {case value="level"}
            <div class="row">
                <div class="col-md-12">
            

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('铜牌价格比例')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-level_one_scale" class="form-control" name="row[level_one_scale]" min="0" type="number" value="{$row.level_one_scale ?? 100}">
                                        <span class="input-group-addon" id="c-level_one_scale">%</span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group hide">
                                <label class="control-label col-xs-12 col-sm-2">{:__('升级铜牌单数')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-level_one_num" class="form-control" name="row[level_one_num]" min="0" type="number" value="{$row.level_one_num ?? 0}">
                                        <span class="input-group-addon" id="c-level_one_num">单</span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('银牌价格比例')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-level_two_scale" class="form-control" name="row[level_two_scale]" min="0" type="number" value="{$row.level_two_scale ?? 100}">
                                        <span class="input-group-addon" id="c-level_two_scale">%</span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('升级银牌单数')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-level_two_num" class="form-control" name="row[level_two_num]" min="0" type="number" value="{$row.level_two_num ?? 100}">
                                        <span class="input-group-addon" id="c-level_two_num">单</span>
                                    </div>
                                </div>
                            </div>

                               <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('金牌价格比例')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-level_three_scale" class="form-control" name="row[level_three_scale]" min="0" type="number" value="{$row.level_three_scale ?? 100}">
                                        <span class="input-group-addon" id="c-level_three_scale">%</span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('升级金牌单数')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input aria-describedby="c-level_three_num" class="form-control" name="row[level_three_num]" min="0" type="number" value="{$row.level_three_num ?? 500}">
                                        <span class="input-group-addon" id="c-level_three_num">单</span>
                                    </div>
                                </div>
                            </div>

                   
                </div>
            </div>
        {/case}
  


        {case value="wxpublic"}

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('APPID')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input id="c-wxpublic_appid" class="form-control" name="row[wxpublic_appid]" type="text" value="{$row.wxpublic_appid ?? ''}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('APPSECRET')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input id="c-wxpublic_secret" class="form-control" name="row[wxpublic_secret]" type="text" value="{$row.wxpublic_secret ?? ''}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('网页授权回调地址')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input id="c-wxpublic_site" class="form-control" name="row[wxpublic_site]" type="text" value="{$row.wxpublic_site ?? ''}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('令牌(Token)')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input id="c-wxpublic_token" class="form-control" name="row[wxpublic_token]" type="text" value="{$row.wxpublic_token ?? ''}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('消息加解密密钥')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-wxpublic_encryption_key" class="form-control" name="row[wxpublic_encryption_key]" type="text" value="{$row.wxpublic_encryption_key ?? ''}">
                </div>
            </div>
        {/case}
        {case value="wxmini"}
 
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Logo')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-wxmini_logo" data-rule="" class="form-control" size="50" name="row[wxmini_logo]" type="text" value="{$row.wxmini_logo ?? ''}">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="faupload-wxmini_logo" class="btn btn-danger faupload" data-input-id="c-wxmini_logo" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-wxmini_logo"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-wxmini_logo"></span>
                    </div>
                    <ul class="row list-inline faupload-preview" id="p-wxmini_logo"></ul>
                </div>
            </div>      
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('APPID')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input id="c-wxmini_appid" class="form-control" name="row[wxmini_appid]" type="text" value="{$row.wxmini_appid ?? ''}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('APPSECRET')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input id="c-wxmini_secret" class="form-control" name="row[wxmini_secret]" type="text" value="{$row.wxmini_secret ?? ''}">
                </div>
            </div>
        {/case}

        {case value="wxpayment"}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('商户号')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input id="c-mch_id" class="form-control" name="row[mch_id]" type="text" value="{$row.mch_id ?? ''}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('支付密钥')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input id="c-mch_key" class="form-control" name="row[mch_key]" type="text" value="{$row.mch_key ?? ''}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('商户证书')}:</label>
                <div class="col-xs-12 col-sm-8">

                        <div class="input-group">
                            <input id="c-apiclient_cert" class="form-control" size="50" name="row[apiclient_cert]" type="text" value="{$row.apiclient_cert ?? ''}" data-tip="可选, 仅退款需要">
                             <div class="input-group-addon no-border no-padding">

                                <span><button type="button" id="faupload-apiclient_cert" class="btn btn-danger faupload"  data-url="xiservice/ajax/upload"  data-input-id="c-apiclient_cert" data-mimetype="pem" data-multiple="false" data-preview-id="p-apiclient_cert"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            </div>
                                <span class="msg-box n-right" for="c-apiclient_cert"><span role="alert" class="msg-wrap n-tip"><span class="n-icon"></span><span class="n-msg">可选, 仅退款需要</span></span></span>
                        </div>  
                        <div style="margin-top:5px;"><a href="https://pay.weixin.qq.com" target="_blank"><i class="fa fa-question-circle"></i> 如何获取微信支付API证书?</a></div>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('商户key证书')}:</label>
                <div class="col-xs-12 col-sm-8">
                <!--
                     <input id="c-apiclient_key"  data-tip="请填写相对路径"  class="form-control" name="row[apiclient_key]" type="text" value="{$row.apiclient_key ?? ''}">
                     <div style="margin-top:5px;"><a href="https://pay.weixin.qq.com" target="_blank"><i class="fa fa-question-circle"></i> 如何获取微信支付API证书?</a></div>
                     -->
                        <div class="input-group">
                            <input id="c-apiclient_key" class="form-control" size="50" name="row[apiclient_key]" type="text" value="{$row.apiclient_key ?? ''}" data-tip="可选, 仅退款需要">
                             <div class="input-group-addon no-border no-padding">

                                <span><button type="button" id="faupload-apiclient_key" class="btn btn-danger faupload"  data-url="xiservice/ajax/upload"  data-input-id="c-apiclient_key" data-mimetype="pem" data-multiple="false" data-preview-id="p-apiclient_key"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            </div>
                                <span class="msg-box n-right" for="c-apiclient_key"><span role="alert" class="msg-wrap n-tip"><span class="n-icon"></span><span class="n-msg">可选, 仅退款需要</span></span></span>
                        </div>  
                        <div style="margin-top:5px;"><a href="https://pay.weixin.qq.com" target="_blank"><i class="fa fa-question-circle"></i> 如何获取微信支付API证书?</a></div>
                </div>
            </div>
        {/case}
    {/switch}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<!--定义模板-->
<script type="text/html" id="testtpl">
    <tr class="form-inline">
        <td><input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="10"></td>
        <td><input type="text" name="row[<%=name%>][<%=index%>][mobile]" class="form-control" value="<%=row['mobile']%>" size="30"></td>
        <td><input type="text" name="row[<%=name%>][<%=index%>][email]" class="form-control" value="<%=row['email']%>" size="30"></td>
        <td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> </td>
    </tr>
</script>